package app.thread;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import app.util.ThreadUtil;


@Service
public class ScanLoginThreadChild implements Runnable {
	
	private static Logger logger = Logger.getLogger(ScanLoginThreadChild.class);
	
	private String key;
	
	public static boolean isFinish;
	
	public ScanLoginThreadChild(){
		isFinish = false;
	}
	
	public void setKey(String key) {
		this.key = key;
	}

	@Override
	public void run() {
		int i=0;
		while(i<5){
			try {
				Thread.sleep(1000);
				ScanLoginThread runningThread = (ScanLoginThread)ThreadUtil.getRunningThread(ScanLoginThread.class.getName());
				runningThread.getWaitScanQrMap(key);
				i++;
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		logger.info("子线程执行完毕");
		isFinish=true;
	}

}
